package com.hlk.feign.fallback;

import com.hlk.feign.UserFeignClient;
import com.hlk.result.Result;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author hlk
 * @version 1.0
 * @date 2021-01-18 14:03
 */
@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {

        return new UserFeignClient() {
            @Override
            public Result queryByIds(String userIds) {
                return Result.error();
            }
        };
    }
}
